﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace RM.BLL
{
    public partial class RMDept
    {
        private readonly DAL.RMDept dal;
        public RMDept()
        {
            dal = new DAL.RMDept();
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.RMDept GetModel(int id)
        {
            return dal.GetModel(id);
        }
        /// <summary>
        /// 删除一条数据，如果删除的是场地或者车间（即父ID为0），那么他所下属的班组（子节点）也将被删除。
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }
        /// <summary>
        /// 判断数据是否存在
        /// </summary>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }
        /// <summary>
        /// 获得部门名称
        /// </summary>
        public string GetDeptName(int id)
        {
            return dal.GetDeptName(id);
        }
        /// <summary>
        /// 添加一条数据
        /// </summary>
        public int Add(Model.RMDept model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 修改更新一条数据。
        /// </summary>
        public bool Update(Model.RMDept model)
        {
            return dal.Update(model);
        }
        /// <summary>
        /// 获取查询分页数据
        /// </summary>
        public DataSet GetList(int pagesize,int pageindex,string strwhere,string fieldorder,out int recordcount)
        {
            return dal.GetList(pagesize, pageindex, strwhere, fieldorder, out recordcount);
        }
    }
}
